package com.tanhua.server.service;


import com.tanhua.domain.mongo.UserLocation;
import com.tanhua.dubbo.api.UserLocationApi;
import com.tanhua.server.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Service
public class BaiduService {

    @Reference
    private UserLocationApi userLocationApi;

    /**
     * 上报地理信息
     */
    public ResponseEntity<Object> saveLocation(Double latitude, Double longitude, String addrStr) {
        // 调用服务提供者api保存地理位置
        userLocationApi.saveLocation(UserHolder.getUserId(), latitude, longitude, addrStr);
        return ResponseEntity.ok(null);
    }
}
